import request from '@/utils/request2'

// 查询常用语列表
export function listApproval(query) {
  return request({
    url: '/approval/approval/list',
    method: 'get',
    params: query
  })
}

// 查询常用语详细
export function getApproval(id) {
  return request({
    url: '/approval/approval/' + id,
    method: 'get'
  })
}
export function getApprovalOfMe() {
  return request({
    url: '/approval/approval/my' ,
    method: 'get'
  })
}

// 新增常用语
export function addApproval(data) {
  return request({
    url: '/approval/approval',
    method: 'post',
    data: data
  })
}

// 修改常用语
export function updateApproval(data) {
  return request({
    headers: {
      'Content-Type': 'application/json'
    },
    url: '/approval/approval/edit',
    method: 'POST',
    data: JSON.stringify(data)
  })
}

// 删除常用语
export function delApproval(id) {
  return request({
    url: '/approval/approval/remove/' + id,
    method: 'GET'
  })
}

// 导出常用语
export function exportApproval(query) {
  return request({
    url: '/approval/approval/export',
    method: 'get',
    params: query
  })
}
